/* $RCSFile: LangChooserEventArgs.cs $
 * Apache license v2 2011 by Christian Surieux
 * $Source: ?/ADNCRM.Core/UI/WebControls/LangChooserEventArgs.cs $
 * $log$
 * Revision 6 2010/08/06 19:56:30  christian.surieux
 *   Added Log to All cs files
 */

using System;
using System.Globalization;
using AddonNice.Helpers;

namespace AddonNice.UI.WebControls
{

    public delegate void LangChooserEventHandler(object sender, LangChooserEventArgs e);

    /// <summary>
    /// LangChooserType lists all variations
    /// Links are search engine friendly.
    /// </summary>
    public enum LangChooserType : int 
    {
        /// <summary>
        /// Language Switch appears as a form (drop-down box)
        /// </summary>
        DropDownList = 0,

        /// <summary>
        /// Language Switch appears as a list of links (vertical)
        /// </summary>
        VerticalLinksList = 1,

        /// <summary>
        /// Language Switch appears as a list of links (horizontal)
        /// </summary>
        HorizontalLinksList = 3
    }

    /// <summary>
    /// LangChooserName lists all possible names
    /// </summary>
    public enum LangChooserName : int
    {
        /// <summary>
        /// Language Switch names appear in the specific language.
        /// en-US is shown in Englis, it-It is shown in Italina, zh-CN in Chinese
        /// </summary>
        NativeName = 0,

        /// <summary>
        /// Language Switch names appear in English
        /// </summary>
        EnglishName = 1,

        /// <summary>
        /// Language Switch names appear in the current UI language
        /// </summary>
        DisplayName = 3
    }

    /// <summary>
    /// LangChooserAction lists all possible ways for changing languages
    /// </summary>
    public enum LangChooserAction : int
    {
        /// <summary>
        /// Language is switched using url.
        /// </summary>
        LinkRedirect = 0,

        /// <summary>
        /// A LanguageChanged event is thrown.
        /// </summary>
        CallDelegate = 1,
    }


    /// <summary>
    /// LangChooserDisplay
    /// </summary>
    [FlagsAttribute] 
    public enum LangChooserDisplay : int
    {
        /// <summary>
        /// Hide the element
        /// </summary>
        DisplayNone = 0,

        /// <summary>
        /// Display the UI Culture from current list
        /// </summary>
        DisplayOutSide = 1,

        /// <summary>
        /// Display the Culture from current list
        /// </summary>
        DisplayInside = 2
    }
    
    /// <summary>
    /// LangChooserDisplay
    /// </summary>
    public enum LangChooserFlagType : int
    {
        /// <summary>
        /// Display the UI Culture from current list
        /// </summary>
        DisplayUICultureList = 1,

        /// <summary>
        /// Display the Culture from current list
        /// </summary>
        DisplayCultureList = 2
    }
    
    /// <summary>
	/// LangChooserEventArgs
	/// </summary>
	public class LangChooserEventArgs : EventArgs
	{
		private LanguageCultureItem cultureItem;

		public LangChooserEventArgs(CultureInfo uiCulture, CultureInfo culture) : base()
		{
			cultureItem = new LanguageCultureItem(uiCulture, culture);
		}

        public LangChooserEventArgs(LanguageCultureItem cultureItem)
            : base()
		{
			this.cultureItem = cultureItem;
		} 

		/// <summary>
		/// Returns the language to change
		/// </summary>
		public LanguageCultureItem CultureItem
		{
			get
			{
				return cultureItem;
			}
		} 
	}
}
